import request from '@/utils/request'

const api_name = `inOutItem`

export default {
    listPage(page,limit,searchObj){
        return request({
            url: `${api_name}/list/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    checkIsNameExist(name){
        return request({
            url: `${api_name}/checkIsNameExist/${name}`,
            method: 'get',
        })
    },
    addInOutItem(inOutItem){
        return request({
            url: `${api_name}/add`,
            method: 'post',
            params: inOutItem
        })
    },
    updateInOutItem(inOutItem){
        return request({
            url: `${api_name}/update`,
            method: 'put',
            params: inOutItem
        })
    },
    batchSetStatus(status,ids){
        return request({
            url: `${api_name}/batchSetStatus/${status}`,
            method: 'post',
            data: ids
        })
    },
    deleteBatch(ids){
        return request({
            url: `${api_name}/deleteBatch`,
            method: 'delete',
            data: ids
        })
    },
    deleteById(id){
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete'
        })
    }
}